+Fri Feb 6 00:45:16 2004 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtkcombobox.c (gtk_combo_box_finalize): Add a finalize
+ function to plug a few memory leaks. (#133544, Morten Welinder)
+
Fri Feb 6 00:15:38 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkcomboboxentry.c (gtk_combo_box_entry_mnemonic_activate):
+Fri Feb 6 00:45:16 2004 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtkcombobox.c (gtk_combo_box_finalize): Add a finalize
+ function to plug a few memory leaks. (#133544, Morten Welinder)
+
Fri Feb 6 00:15:38 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkcomboboxentry.c (gtk_combo_box_entry_mnemonic_activate):
+Fri Feb 6 00:45:16 2004 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtkcombobox.c (gtk_combo_box_finalize): Add a finalize
+ function to plug a few memory leaks. (#133544, Morten Welinder)
+
Fri Feb 6 00:15:38 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkcomboboxentry.c (gtk_combo_box_entry_mnemonic_activate):
+Fri Feb 6 00:45:16 2004 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtkcombobox.c (gtk_combo_box_finalize): Add a finalize
+ function to plug a few memory leaks. (#133544, Morten Welinder)
+
Fri Feb 6 00:15:38 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkcomboboxentry.c (gtk_combo_box_entry_mnemonic_activate):
+Fri Feb 6 00:45:16 2004 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtkcombobox.c (gtk_combo_box_finalize): Add a finalize
+ function to plug a few memory leaks. (#133544, Morten Welinder)
+
Fri Feb 6 00:15:38 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkcomboboxentry.c (gtk_combo_box_entry_mnemonic_activate):
guint prop_id,
GValue *value,
GParamSpec *spec);
+static void gtk_combo_box_finalize (GObject *object);
static void gtk_combo_box_style_set (GtkWidget *widget,
GtkStyle *previous_style,
widget_class->mnemonic_activate = gtk_combo_box_mnemonic_activate;
object_class = (GObjectClass *)klass;
+ object_class->finalize = gtk_combo_box_finalize;
object_class->set_property = gtk_combo_box_set_property;
object_class->get_property = gtk_combo_box_get_property;
GtkWidget *
gtk_combo_box_new (void)
{
- return GTK_WIDGET (g_object_new (gtk_combo_box_get_type (), NULL));
+ return GTK_WIDGET (g_object_new (GTK_TYPE_COMBO_BOX, NULL));
}
/**
g_return_val_if_fail (GTK_IS_TREE_MODEL (model), NULL);
- combo_box = GTK_COMBO_BOX (g_object_new (gtk_combo_box_get_type (),
+ combo_box = GTK_COMBO_BOX (g_object_new (GTK_TYPE_COMBO_BOX,
"model", model,
NULL));
return TRUE;
}
+
+static void
+gtk_combo_box_finalize (GObject *object)
+{
+ GtkComboBox *combo_box = GTK_COMBO_BOX (object);
+
+ if (GTK_IS_MENU (combo_box->priv->popup_widget))
+ gtk_combo_box_menu_destroy (combo_box);
+
+ if (GTK_IS_TREE_VIEW (combo_box->priv->tree_view))
+ gtk_combo_box_list_destroy (combo_box);
+
+ if (combo_box->priv->popup_window)
+ gtk_widget_destroy (combo_box->priv->popup_window);
+
+ if (combo_box->priv->model)
+ g_object_unref (combo_box->priv->model);
+
+ g_slist_foreach (combo_box->priv->cells, (GFunc)g_free, NULL);
+ g_slist_free (combo_box->priv->cells);
+
+ G_OBJECT_CLASS (parent_class)->finalize (object);
+}